
import $ from "@/utils/requset"
// 获取权限数据
const getRightsList = () => $.getAxios("/rights/list")
// 获取角色数据
const getRightsRoles = () => $.getAxios("/roles")
// 删除数据
const deleteRigthtsRoles = (id) => $.deleteAxios(`/roles/${id}`)
const deleteRolesRights = (id, itemId) => $.deleteAxios(`/roles/${id}/rights/${itemId}`)
// 添加数据
const postRigthtsRoles = (data) => $.postAxios(`/roles`, { ...data })
const getRigthtsRoles = (id) => $.getAxios(`/roles/${id}`)
const putRigthtsRoles = (id, data) => $.putAxios(`/roles/${id}`, { ...data })
const getTree = () => $.getAxios(`/rights/tree`)

const postRigthtsRights = (id, data) => $.postAxios(`/roles/${id}/rights`, { ...data })

// const postLogin = ({
//     username = null,
//     password = null
// } = {}) => $.postAxios('login', {
//     username,
//     password
// })

export default {
    // 权限列表数据请求
    getRightsList,
    getRightsRoles,
    deleteRigthtsRoles,
    deleteRolesRights,
    postRigthtsRoles,
    putRigthtsRoles,
    getRigthtsRoles,
    getTree,
    postRigthtsRights
    // postLogin,
}